Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
How to escape the ampersand in "$quote;"

I use a kendo template in jsp:

<assd:column has-tooltip="false" width="150px" name="groupName"
                             template="<span data-link-value='{gId:&quot;#:id#&quot;, gName:&quot;#:schoolNameSafe# группа #:groupNameSafe# (#:groupType#)&quot;, gType:&quot;#:groupTypeId#&quot;, imported:&quot;#:hasLicenses#&quot;}'>#:groupName#</span>"
                >Group</assd:column>

And also a JavaScript logic like:

var template = kendo.template(this.rowLinkTemplate);
var fieldData = {};

var dataLinkValue = $("[data-link-value]", arg.currentTarget).attr("data-link-value");
var link = template(eval("(" + dataLinkValue + ")"));
document.location = link;

I have an input string for gName: "CDS "Car Driving School""

The problem is in ampersand in $quot; which is perceived by browser as a delimiter and it turns out that CDS goes to the gName variable, but everything after is considered a key because of the ampersand.

Is it possible to escape the ampersand in $quot;?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Is there any reason you couldn't just use " normally and escape it (rather than encode it)? e.g.

<assd:column has-tooltip="false" width="150px" name="groupName"
    template="<span data-link-value='{gId:\"#:id#\", gName:\"#:schoolNameSafe# группа #:groupNameSafe# (#:groupType#)\", gType:\"#:groupTypeId#\", imported:\"#:hasLicenses#\"}'>#:groupName#</span>"
>Group</assd:column>

Disclaimer: I don't know much about kendo so it is entirely possible that there is a reason that this can't be done that I'm unaware of.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda